/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EJBTool.impl;

import EJBTool.DeplyomentView;
import EJBTool.EJB;
import EJBTool.EJBToolPackage;
import EJBTool.EntityBean;
import EJBTool.Module;

import java.util.Collection;

import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Deplyoment View</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EJBTool.impl.DeplyomentViewImpl#getEJBs <em>EJ Bs</em>}</li>
 *   <li>{@link EJBTool.impl.DeplyomentViewImpl#getModules <em>Modules</em>}</li>
 *   <li>{@link EJBTool.impl.DeplyomentViewImpl#getEntityBeans <em>Entity Beans</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class DeplyomentViewImpl extends EObjectImpl implements DeplyomentView
{
	/**
	 * The cached value of the '{@link #getEJBs() <em>EJ Bs</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEJBs()
	 * @generated
	 * @ordered
	 */
	protected EList<EJB> ejBs;

	/**
	 * The cached value of the '{@link #getModules() <em>Modules</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getModules()
	 * @generated
	 * @ordered
	 */
	protected EList<Module> modules;

	/**
	 * The cached value of the '{@link #getEntityBeans() <em>Entity Beans</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getEntityBeans()
	 * @generated
	 * @ordered
	 */
	protected EList<EntityBean> entityBeans;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected DeplyomentViewImpl()
	{
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass()
	{
		return EJBToolPackage.Literals.DEPLYOMENT_VIEW;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<EJB> getEJBs()
	{
		if (ejBs == null)
		{
			ejBs = new EObjectContainmentEList<EJB>(EJB.class, this, EJBToolPackage.DEPLYOMENT_VIEW__EJ_BS);
		}
		return ejBs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<Module> getModules()
	{
		if (modules == null)
		{
			modules = new EObjectContainmentEList<Module>(Module.class, this, EJBToolPackage.DEPLYOMENT_VIEW__MODULES);
		}
		return modules;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<EntityBean> getEntityBeans()
	{
		if (entityBeans == null)
		{
			entityBeans = new EObjectContainmentEList<EntityBean>(EntityBean.class, this, EJBToolPackage.DEPLYOMENT_VIEW__ENTITY_BEANS);
		}
		return entityBeans;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
	{
		switch (featureID)
		{
			case EJBToolPackage.DEPLYOMENT_VIEW__EJ_BS:
				return ((InternalEList<?>)getEJBs()).basicRemove(otherEnd, msgs);
			case EJBToolPackage.DEPLYOMENT_VIEW__MODULES:
				return ((InternalEList<?>)getModules()).basicRemove(otherEnd, msgs);
			case EJBToolPackage.DEPLYOMENT_VIEW__ENTITY_BEANS:
				return ((InternalEList<?>)getEntityBeans()).basicRemove(otherEnd, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType)
	{
		switch (featureID)
		{
			case EJBToolPackage.DEPLYOMENT_VIEW__EJ_BS:
				return getEJBs();
			case EJBToolPackage.DEPLYOMENT_VIEW__MODULES:
				return getModules();
			case EJBToolPackage.DEPLYOMENT_VIEW__ENTITY_BEANS:
				return getEntityBeans();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue)
	{
		switch (featureID)
		{
			case EJBToolPackage.DEPLYOMENT_VIEW__EJ_BS:
				getEJBs().clear();
				getEJBs().addAll((Collection<? extends EJB>)newValue);
				return;
			case EJBToolPackage.DEPLYOMENT_VIEW__MODULES:
				getModules().clear();
				getModules().addAll((Collection<? extends Module>)newValue);
				return;
			case EJBToolPackage.DEPLYOMENT_VIEW__ENTITY_BEANS:
				getEntityBeans().clear();
				getEntityBeans().addAll((Collection<? extends EntityBean>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID)
	{
		switch (featureID)
		{
			case EJBToolPackage.DEPLYOMENT_VIEW__EJ_BS:
				getEJBs().clear();
				return;
			case EJBToolPackage.DEPLYOMENT_VIEW__MODULES:
				getModules().clear();
				return;
			case EJBToolPackage.DEPLYOMENT_VIEW__ENTITY_BEANS:
				getEntityBeans().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID)
	{
		switch (featureID)
		{
			case EJBToolPackage.DEPLYOMENT_VIEW__EJ_BS:
				return ejBs != null && !ejBs.isEmpty();
			case EJBToolPackage.DEPLYOMENT_VIEW__MODULES:
				return modules != null && !modules.isEmpty();
			case EJBToolPackage.DEPLYOMENT_VIEW__ENTITY_BEANS:
				return entityBeans != null && !entityBeans.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //DeplyomentViewImpl
